<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrappe">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="单据来源">
              <j-dict-select-tag placeholder="请选择单据来源" @input="handleDocumentSource" v-model="queryParam.permissionType" dictCode="permission_type"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="queryParam.permissionType == 3">
            <a-form-item label="选择部门">
              <J-select-multiple
                placeholder="请选择选择部门"
                :options="getDepartName"
                showId="id"
                v-model="queryParam.deptIds"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="queryParam.permissionType == 4">
            <a-form-item label="选择团队">
              <J-select-multiple
                placeholder="请选择选择团队"
                :options="getTeamName"
                showId="id"
                v-model="queryParam.teamIds"/>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="单据编号">
              <j-input placeholder="请输入单据编号" v-model="queryParam.billNo"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目名称">
              <j-input placeholder="请输入项目名称" v-model="queryParam.projectName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="queryParam.permissionType == 4">
            <a-form-item label="经营团队">
              <select-team-input v-model="queryParam.teamName" :tdlx="1" :teamType="0"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目承接人">
              <j-input placeholder="请输入项目承接人" v-model="queryParam.undertakerName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="预计合同额(元)">
              <a-input-number
                :max="99999999"
                :min="0"
                :precision="2"
                v-model="queryParam.estimatedContractAmount_begin"
                @change="(val) => this.estimatedEstimatedContractAmount = Number(val)"
                placeholder="请输入最小金额"
                style="width: 47%"/>
              -
              <a-input-number
                :max="99999999"
                :min="estimatedEstimatedContractAmount"
                :precision="2"
                v-model="queryParam.estimatedContractAmount_end"
                placeholder="请输入最大金额"
                style="width: 47%"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="业务分类">
              <business-category-name-select v-model="queryParam.categoryCode" @back="businessCategoryHandle"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同占比(%)">
              <a-input-number
                :max="99999999"
                :min="0"
                :precision="2"
                style="width: 47%"
                v-model="queryParam.contractRate_begin"
                @change="(val) => this.estimatedContractRate = Number(val)"
                placeholder="请输入最小值"/>
              -
              <a-input-number
                :max="99999999"
                :min="estimatedContractRate"
                :precision="2"
                v-model="queryParam.contractRate_end"

                placeholder="请输入最大值"
                style="width: 47%"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="合同分配额(元)">
              <a-input-number
                :max="99999999"
                :min="0"
                :precision="2"
                style="width: 47%"
                @change="(val) => this.estimatedContractAmount = Number(val)"
                v-model="queryParam.contractAmount_begin"
                placeholder="请输入最小金额"/>
              -
              <a-input-number
                :max="99999999"
                :min="estimatedContractAmount"
                :precision="2"
                v-model="queryParam.contractAmount_end"
                placeholder="请输入最大金额"
                style="width: 47%"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24" v-if="queryParam.permissionType == 4">
            <a-form-item label="生产团队">
              <select-team-input
                placeholder="请选择生产团队"
                v-model="queryParam.productTeam"
                :teamType="0"
                :tdlx="2"
                :triggerChange="true"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="实施部门" :labelCol="labelCol" :wrapperCol="wrapperCol" class="form-item">
              <j-select-depart placeholder="请选择实施部门" v-model="queryParam.executeDepart"/>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="项目负责人" prop="projLeadName" :labelCol="labelCol" :wrapperCol="wrapperCol" class="form-item">
              <j-input placeholder="请输入项目负责人" v-model="queryParam.projLeadName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="部门负责人" prop="deptLeadName" :labelCol="labelCol" :wrapperCol="wrapperCol" class="form-item">
              <j-input placeholder="请输入部门负责人" v-model="queryParam.deptLeadName"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="流程状态" :labelCol="labelCol" :wrapperCol="wrapperCol" class="form-item">
              <j-dict-select-tag placeholder="请选择流程状态" v-model="queryParam.bpmStatus" dictCode="bpm_status"/>
            </a-form-item>
          </a-col>
          <!-- <template v-if="toggleSearchStatus"></template> -->
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus" :disabled="isDisabledAuth('erpOmcPrepareProject:add')">
        新增任务委托
      </a-button>
      <a-button @click="handleTaskChangeAdd" type="primary" icon="plus" :disabled="isDisabledAuth('erpOmcPrepareProject:add')">
        变更任务委托
      </a-button>
      <!--      <a-button type="primary" icon="download" @click="handleExportXls('预立项管理')"-->
      <!--                :disabled="isDisabledAuth('erpOmcPrepareProject:export')">导出-->
      <!--      </a-button>-->
      <!--      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
      <!--                @change="handleImportExcel">-->
      <!--        <a-button type="primary" icon="import" :disabled="isDisabledAuth('erpOmcPrepareProject:import')">导入</a-button>-->
      <!--      </a-upload>-->
      <!-- 高级查询区域 -->
      <!--<j-super-query :fieldList="superFieldList" ref="superQueryModal" @handleSuperQuery="handleSuperQuery"></j-super-query>-->
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel" :disabled="isDisabledAuth('erpOmcPrepareProject:delete')">
            <a-icon type="delete"/>
            删除
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
      <a-popover title="自定义列" trigger="click" placement="leftBottom">
        <template slot="content">
          <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns" :defaultValue="settingColumns">
            <a-row>
              <template v-for="(item,index) in defColumns">
                <template v-if="item.key!='rowIndex'&& item.dataIndex!='action'">
                  <a-col :span="12" :key="index">
                    <a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox>
                  </a-col>
                </template>
              </template>
            </a-row>
          </a-checkbox-group>
        </template>
        <a style="float: right;">
          <a-icon type="setting" :style="iconStyle"/>
        </a>
      </a-popover>
    </div>
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
          style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{x:scrollX}"
        :components="draggableComponent"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps: (record) => { return { props: { disabled: record.bpmStatus !== '1' } } }}"
        class="j-table-force-nowrap"
        :customRow="customRow"
        @change="handleTableChange">
        <span slot="notify" slot-scope="text, record">
          <a-icon
            title="催办提醒"
            v-if="record.taskUrge"
            theme="twoTone"
            twoToneColor="#eb2f96"
            @click="taskNotifyMe(flowCode,record.id)"
            type="notification"/>
          {{ text }}
        </span>
        <template slot="status" slot-scope="status">
          <a-badge :status="status | statusTypeFilter" :text="status | statusFilter"/>
        </template>
        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img
            v-else
            :src="getImgView(text)"
            height="25px"
            alt=""
            style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="pcaSlot" slot-scope="text">
          <div>{{ getPcaText(text) }}</div>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="downloadFile(text)">
            下载
          </a-button>
        </template>
        <span slot="action" slot-scope="text, record">
          <template v-if="record.bpmStatus === '1'">
            <a-button
              v-if="Number(record.applyType) === 1"
              class="ruleButton"
              :ghost="true"
              type="primary"
              icon="edit"
              @click="handleEdit(record)"
              :disabled="isDisabledAuth('erpOmcPrepareProject:edit')"
            />
            <a-button
              v-if="Number(record.applyType) === 2"
              class="ruleButton"
              :ghost="true"
              type="primary"
              icon="edit"
              @click="handleBGEdit(record)"
              :disabled="isDisabledAuth('erpOmcPrepareProject:edit')"
            />
            <a-divider type="vertical"/>
            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
              <a-button
                class="ruleButton"
                :ghost="true"
                type="primary"
                icon="delete"
                :disabled="isDisabledAuth('erpOmcPrepareProject:delete')"/>
            </a-popconfirm>
            <!-- <a-divider type="vertical"/>
            <a-button
              type="primary"
              size="small"
              @click="beginProcess(record)"
              :disabled="isDisabledAuth('erpOmcPrepareProject:startProcess')">发起流程</a-button> -->
          </template>
          <template v-else-if="showBtn(record.bpmStatus)&&queryParam.bizTaskType=='1'">
            <a-button type="primary" size="small" @click="handleProcess(record)">办理</a-button>
            <a-divider type="vertical"/>
          </template>
          <template v-else-if="queryParam.bizTaskType=='2' && showBtn(record.bpmStatus)">
            <a-button type="primary" size="small" @click="taskNotify(flowCode,record.id)">催办</a-button>
            <a-divider type="vertical"/>
            <a-popconfirm title="确定要作废吗?" @confirm="() => invalidProcess(record)">
              <a-button type="primary" size="small" :disabled="isDisabledAuth('erpOmcPrepareProject:invalidProcess')">
                作废流程
              </a-button>
            </a-popconfirm>
            <a-divider type="vertical"/>
          </template>
          <template v-if="record.bpmStatus !== '1'">
            <a-button
              type="primary"
              size="small"
              @click="handleTrack(record)"
              :disabled="isDisabledAuth('erpOmcPrepareProject:viewTrack')">审批进度</a-button>
          </template>
        </span>
      </a-table>
    </div>
    <ErpOmcTaskDistributionModal ref="modalForm" :type="type" @ok="modalFormOk" :taskId="taskId" :projectNameId="projectNameId"></ErpOmcTaskDistributionModal>
    <bpm-biz-task-deal-modal
      ref="taskDealModal"
      :path="path"
      :formData="formData"
      @ok="handleOk"></bpm-biz-task-deal-modal>
    <bpm-process-track-modal ref="bpmProcessTrackModal"></bpm-process-track-modal>
    <biz-task-notify-modal ref="taskNotifyModal"></biz-task-notify-modal>
    <biz-task-notify-me-modal ref="taskNotifyMeModal"></biz-task-notify-me-modal>
    <process-config-modal ref="processConfig" @ok="handleSuccess" @close="handleClose"></process-config-modal>
    <TaskChangeModal ref="taskChangeModal" :type="type" :taskId="taskId" :projectNameId="projectNameId" @ok="modalFormOk"></TaskChangeModal>
  </a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgBpmListMixin } from '@/mixins/JeecgBpmListMixin'
import BpmBizTaskDealModal from '@/views/modules/bpmbiz/common/BpmBizTaskDealModal.vue';
import BpmProcessTrackModal from '@/views/modules/bpmbiz/common/BpmProcessTrackModal.vue';
import BizTaskNotifyModal from '@/views/modules/bpmbiz/common/BizTaskNotifyModal.vue';
import BizTaskNotifyMeModal from '@/views/modules/bpmbiz/common/BizTaskNotifyMeModal.vue';
import ErpOmcTaskDistributionModal from './modules/ErpOmcTaskDistributionModal'
import Area from '@/components/_util/Area'
import { DisabledAuthFilterMixin } from '@/mixins/DisabledAuthFilterMixin'
import SelectUserByDep from '@/views/scy/components/SelectUserByDep'
import SelectTeamInput from '@/views/scy/components/SelectTeamInput'
import SelectCustomerInput from '@/views/scy/components/SelectCustomerInput'
import ProcessConfigModal from '@/views/scy/components/ProcessConfigModal'
import SelectCompanyInput from '@/views/scy/components/SelectCompanyInput'
import BusinessCategoryNameSelect from '@views/erp/components/BusinessCategoryNameSelect'
import { getAction } from '@/api/manage'
import TaskChangeModal from './modules/taskchange/ErpProgressTaskChangeListModal.vue'
export default {
  name: 'ErpOmcTaskDistributionList',
  mixins: [JeecgBpmListMixin, mixinDevice, DisabledAuthFilterMixin],
  components: {
    ErpOmcTaskDistributionModal,
    BpmBizTaskDealModal,
    BpmProcessTrackModal,
    BizTaskNotifyModal,
    BizTaskNotifyMeModal,
    SelectUserByDep,
    SelectTeamInput,
    SelectCustomerInput,
    ProcessConfigModal,
    SelectCompanyInput,
    BusinessCategoryNameSelect,
    TaskChangeModal
  },
  data() {
    return {
      type: '',
      isorter: {
        column: 'createTime',
        order: 'desc'
      },
      dictOptions: {},
      description: '任务委托管理管理页面',
      // 表头
      columns: [],
      // 列设置
      settingColumns: [],
      // 列定义
      defColumns: [
        {
          title: '序号',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          ellipsis: true,
          customRender: function (t, r, index) {
            return parseInt(index) + 1;
          }
        },
        {
          title: '单据编号',
          align: 'center',
          dataIndex: 'billNo',
          width: 132,
          ellipsis: true
        },
        {
          title: '项目名称',
          align: 'center',
          dataIndex: 'projectName',
          width: 132,
          ellipsis: true
        },
        {
          title: '申请类型',
          align: 'center',
          dataIndex: 'applyType_dictText',
          width: 132,
          ellipsis: true
        },
        {
          title: '经营团队',
          align: 'center',
          dataIndex: 'signteamName',
          width: 132,
          ellipsis: true
        },
        {
          title: '项目承接人',
          align: 'center',
          dataIndex: 'undertakerName',
          width: 132,
          ellipsis: true
        },
        {
          title: '预计合同额(元)',
          align: 'center',
          dataIndex: 'estimatedContractAmount',
          width: 132,
          ellipsis: true
        },
        {
          title: '业务分类',
          align: 'center',
          dataIndex: 'categoryName',
          width: 132,
          ellipsis: true
        },
        {
          title: '合同占比(%)',
          align: 'center',
          dataIndex: 'contractRate',
          width: 132,
          ellipsis: true
        },
        {
          title: '合同分配额(元)',
          align: 'center',
          dataIndex: 'contractAmount',
          width: 132,
          ellipsis: true
        },
        {
          title: '生产团队',
          align: 'center',
          dataIndex: 'productTeam_dictText',
          width: 132,
          ellipsis: true
        },
        {
          title: '实施部门',
          align: 'center',
          dataIndex: 'executeDepart_dictText',
          width: 132,
          ellipsis: true
        },
        {
          title: '部门负责人',
          align: 'center',
          dataIndex: 'deptLeadName',
          width: 132,
          ellipsis: true
        },
        {
          title: '项目负责人',
          align: 'center',
          dataIndex: 'projLeadName',
          width: 132,
          ellipsis: true
        },
        {
          title: '流程状态',
          align: 'center',
          dataIndex: 'bpmStatus_dictText',
          width: 132,
          ellipsis: true
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 160,
          scopedSlots: {
            filterDropdown: 'filterDropdown',
            filterIcon: 'filterIcon',
            customRender: 'action'
          }
        }
      ],
      url: {
        list: '/api/erp/omc/task/erpOmcTaskDistribution/list',
        delete: '/api/erp/omc/task/erpOmcTaskDistribution/delete',
        deleteBatch: '/api/erp/omc/task/erpOmcTaskDistribution/deleteBatch',
        exportXlsUrl: '/api/erp/omc/task/erpOmcTaskDistribution/exportXls',
        importExcelUrl: 'api/erp/omc/task/erpOmcTaskDistribution/importExcel',
        bizCount: '/api/erp/omc/task/erpOmcTaskDistribution/bizCount'
      },
      // 代码生成后需手动设置流程编码
      flowCode: 'dev_erp_omc_task_distribution_001',
      flowChangeCode: 'dev_erp_omc_task_distribution_002',
      beanName: 'erpOmcTaskDistributionServiceImpl',
      formUrl: '/erp/omc/taskdistribution/modules/ErpOmcTaskDistributionForm',
      formChangeUrl: '/erp/omc/taskdistribution/modules/taskchange/ErpProgressTaskChangeListForm',
      formUrlMobile: '/pages/synergy/ErpOmcTaskDistributionForm',
      formChangeUrlMobile: '/pages/synergy/ErpOmcTaskChangeForm',
      pcaData: '',
      superFieldList: [],
      processId: '1557666877169283074',
      taskId: this.$route.query.id ? this.$route.query.id : '', // 任务档案携带的id值
      projectNameId: '', // 任务档案携带的id值
      timer: null,

      estimatedContractRate: 0,
      estimatedContractAmount: 0,
      estimatedEstimatedContractAmount: 0
    }
  },
  created() {
    this.pcaData = new Area()
    this.getSuperFieldList();
  },
  watch: {
    '$route.query': {
      handler (val) {
        if (val) {
          this.taskId = this.$route.query.id
          this.projectNameId = this.$route.query.projectId
          this.type = this.$route.query.type
        }
      },
      immediate: true
    }
  },
  beforeDestroy () {
    clearTimeout(this.timer)
    this.timer = null
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
    }
  },
  methods: {
    handleTrack(record) {
      let flowCode = this.flowCode;
        if (Number(record.applyType) === 2) {
          flowCode = this.flowChangeCode;
        }
      var params = { flowCode: flowCode, dataId: record.id };// 查询条件
      this.$refs.bpmProcessTrackModal.handleTrack(params);
      this.$refs.bpmProcessTrackModal.title = '审批跟踪记录';
    },
    beginProcess(record) {
      // 判断是否在变更中 20230904 暂时放开任务委托校验
      getAction('/api/erp/omc/project/erpOmcProjectTask/checkTaskChangeById', { id: record.taskId }).then(res => {
        if (res.success) {
          this.getProcess(record)
        } else {
          this.$message.warning(res.message)
          this.handleClose()
        }
      })
    },
    // 获取流程
    getProcess (record) {
      this.$refs.processConfig.visible = true
      if (Number(record.applyType) === 2) {
        this.$refs.processConfig.formUrl = '/erp/omc/taskdistribution/modules/taskchange/ErpProgressTaskChangeListForm'
        this.$refs.processConfig.formUrlMobile = '/pages/synergy/ErpOmcTaskChangeForm'
        this.$refs.processConfig.flowCode = 'dev_erp_omc_task_distribution_002'
        this.$refs.processConfig.edit(record, this.processId, 'erpOmcTaskDistributionChangeServiceImpl')
      } else {
        this.$refs.processConfig.formUrl = this.formUrl
        this.$refs.processConfig.formUrlMobile = this.formUrlMobile
        this.$refs.processConfig.flowCode = this.flowCode
        this.$refs.processConfig.edit(record, this.processId, this.beanName)
      }
    },
    handleSuccess() {
      this.loadData();
      this.$refs.modalForm.handleCancel()
      this.$refs.taskChangeModal.handleCancel()
      this.taskId && this.$bus.$emit('update-id-tab')
      this.onClearSelected();
    },
    // 新增流程取消关闭弹窗刷新页面
    handleClose () {
      this.$refs.modalForm.handleCancel()
      this.$refs.taskChangeModal.handleCancel()
      this.taskId && this.$bus.$emit('update-id-tab')
      this.loadData();
    },
    searchQuery() {
      let queryParam = {};
      Object.assign(queryParam, this.queryParam)
      this.loadData(1);
    },
    businessCategoryHandle (obj) {
      this.queryParam.categoryName = null
      if (obj) {
        this.queryParam.categoryName = obj.categoryName;
      }
    },
    async loadData(arg) {
      if (!this.url.list) {
        this.$message.error('请设置url.list属性!')
        return
      }
      // 加载数据 若传入参数1则加载第一页的内容
      if (arg === 1) {
        this.ipagination.current = 1;
      }
      var params = this.getQueryParams();// 查询条件
      params.pageUrl = this.$route.path
      params.categoryCode = null
      this.loading = true;
      let res = await getAction(this.url.list, params)
      this.loading = false;
      if (res.success) {
        this.dataSource = res.result.records;
        this.ipagination.total = res.result.total;
        // 判断是否当前页没有数据且不为第一页
        if (this.dataSource.length == 0 && this.ipagination.current != 1) {
          this.ipagination.current = this.ipagination.current - 1
          this.loadData(this.ipagination.current - 1);
        }
        const data = [...this.dataSource];
        if (this.queryParam.bizTaskType == '1') {
          for (var i = 0; i < data.length; i++) {
            // item.taskUrge = false;
            var item = data[i];
            var params1 = { flowCode: this.flowCode, dataId: item.id };// 查询条件
            let res2 = await getAction(this.url.checkNotify, params1);
            if (res2.result) {
              item.taskUrge = true;
            }
          }
        }
        this.dataSource = data;
      }
      this.bizCount();
    },
    cf (data1, data2) { // 乘法
      let m = 0; let s1 = data1.toString(); let s2 = data2.toString();
      // 获取所有参数小数位长度之和
      try { m += s1.split('.')[1].length } catch (e) {}
      try { m += s2.split('.')[1].length } catch (e) {}
      // 替换掉小数点转为数字相乘再除以10的次幂值
      return Number(s1.replace('.', '')) * Number(s2.replace('.', '')) / Math.pow(10, m);
    },
    getPcaText(code) {
      return this.pcaData.getText(code);
    },
    getSuperFieldList() {
      let fieldList = [];
      fieldList.push({ type: 'string', value: 'projectName', text: '项目名称', dictCode: '' })
      fieldList.push({ type: 'int', value: 'xmlx', text: '项目类型', dictCode: 'xmlx_type' })
      fieldList.push({ type: 'string', value: 'ywtd', text: '经营团队', dictCode: '' })
      fieldList.push({ type: 'string', value: 'undertakerName', text: '承接人', dictCode: '' })
      fieldList.push({ type: 'int', value: 'sfztb', text: '是否招投标', dictCode: 'yn' })
      fieldList.push({ type: 'int', value: 'sfhpxm', text: '是否环评项目', dictCode: 'yn' })
      fieldList.push({ type: 'string', value: 'qddw', text: '签订单位', dictCode: '' })
      fieldList.push({ type: 'int', value: 'yjgsnd', text: '业绩归属年度', dictCode: 'yjgsnd' })
      fieldList.push({ type: 'string', value: 'yzdw', text: '业主单位', dictCode: '' })
      fieldList.push({ type: 'string', value: 'lxr', text: '联系人', dictCode: '' })
      fieldList.push({ type: 'string', value: 'lxdh', text: '联系电话', dictCode: '' })
      fieldList.push({ type: 'pca', value: 'ssq', text: '省市区' })
      fieldList.push({ type: 'int', value: 'categoryName', text: '项目来源', dictCode: 'xmly_type' })
      fieldList.push({ type: 'double', value: 'yjhte', text: '预计合同额（元）', dictCode: '' })
      fieldList.push({ type: 'string', value: 'dx', text: '大写', dictCode: '' })
      fieldList.push({ type: 'string', value: 'sbr', text: '申报人', dictCode: '' })
      fieldList.push({ type: 'date', value: 'sbsj', text: '申报时间' })
      fieldList.push({ type: 'string', value: 'lxsyjsm', text: '立项事由及说明', dictCode: '' })
      fieldList.push({ type: 'string', value: 'xgfj', text: '相关附件', dictCode: '' })
      fieldList.push({ type: 'string', value: 'bpmStatus', text: '状态', dictCode: '' })
      this.superFieldList = fieldList
    },
    handleTaskChangeAdd() {
      this.$refs.taskChangeModal.add()
    },
    // 变更任务委托 编辑
    handleBGEdit(record) {
      this.$refs.taskChangeModal.edit(record)
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
